package com.vita.testCore.value;

import java.util.List;
import java.util.UUID;

/**
 * inout数值必须在out数值之前set
 * output可缺省
 */
public class CvtList<I,O> extends Cvt implements CvtMetaInfo{
    private final static String KEY = "CvtList";
    private String id;
    private List<I> inputs;
    private List<O> outputs;

    {
        id = UUID.randomUUID().toString().replaceAll("-","");
    }



    public CvtList() {
    }
    
    public CvtList(List<I> is) {
        this.inputs = is;
    }

    public CvtList(List<I> is,List<O> os) {
        this.inputs = is;
        this.outputs = os;
    }

    public void input(I i){
        this.inputs.add(i);
    }

    public List<I> getInput(){
       return this.inputs;
    }

    public void output(O o){
        this.outputs.add(o);
    }

    public List<O> getOutput(){
        return this.outputs;
     }

    @Override
    public String getKey() {
        return KEY;
    }

    @Override
    public String getId() {
        return id;
    }
}
